from tortoise import Model,fields
class User(Model):
    """数据库中的user表"""
    id = fields.IntField(pk=True)
    username = fields.CharField(max_length=255)
    password = fields.CharField(max_length=255)
    name = fields.CharField(max_length=255)
    created_at = fields.DatetimeField(auto_now_add=True)  #添加记录时,自动添加当前时间
    updated_at = fields.DatetimeField(auto_now=True)      #修改记录时,自动修改当前时间